3.157 \(\int (d x)^{-1+n} \log ^2(c x^n) \, dx\)

Optimal. Leaf size=53 \[ \frac {(d x)^n \log ^2\left (c x^n\right )}{d n}-\frac {2 (d x)^n \log \left (c x^n\right )}{d n}+\frac {2 (d x)^n}{d n} \]

[Out]

2*(d*x)^n/d/n-2*(d*x)^n*ln(c*x^n)/d/n+(d*x)^n*ln(c*x^n)^2/d/n

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 53, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {2305, 2304} \[ \frac {(d x)^n \log ^2\left (c x^n\right )}{d n}-\frac {2 (d x)^n \log \left (c x^n\right )}{d n}+\frac {2 (d x)^n}{d n} \]

Antiderivative was successfully verified.

[In]

Int[(d*x)^(-1 + n)*Log[c*x^n]^2,x]

[Out]

(2*(d*x)^n)/(d*n) - (2*(d*x)^n*Log[c*x^n])/(d*n) + ((d*x)^n*Log[c*x^n]^2)/(d*n)

Rule 2304

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[((d*x)^(m + 1)*(a + b*Log[c*x^
n]))/(d*(m + 1)), x] - Simp[(b*n*(d*x)^(m + 1))/(d*(m + 1)^2), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1
]

Rule 2305

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[((d*x)^(m + 1)*(a + b*Lo
g[c*x^n])^p)/(d*(m + 1)), x] - Dist[(b*n*p)/(m + 1), Int[(d*x)^m*(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{
a, b, c, d, m, n}, x] && NeQ[m, -1] && GtQ[p, 0]

Rubi steps

\begin {align*} \int (d x)^{-1+n} \log ^2\left (c x^n\right ) \, dx &=\frac {(d x)^n \log ^2\left (c x^n\right )}{d n}-2 \int (d x)^{-1+n} \log \left (c x^n\right ) \, dx\\ &=\frac {2 (d x)^n}{d n}-\frac {2 (d x)^n \log \left (c x^n\right )}{d n}+\frac {(d x)^n \log ^2\left (c x^n\right )}{d n}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 30, normalized size = 0.57 \[ \frac {(d x)^n \left (\log ^2\left (c x^n\right )-2 \log \left (c x^n\right )+2\right )}{d n} \]

Antiderivative was successfully verified.

[In]

Integrate[(d*x)^(-1 + n)*Log[c*x^n]^2,x]

[Out]

((d*x)^n*(2 - 2*Log[c*x^n] + Log[c*x^n]^2))/(d*n)

________________________________________________________________________________________

fricas [A]  time = 0.45, size = 42, normalized size = 0.79 \[ \frac {{\left (n^{2} \log \relax (x)^{2} + \log \relax (c)^{2} + 2 \, {\left (n \log \relax (c) - n\right )} \log \relax (x) - 2 \, \log \relax (c) + 2\right )} d^{n - 1} x^{n}}{n} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x)^(-1+n)*log(c*x^n)^2,x, algorithm="fricas")

[Out]

(n^2*log(x)^2 + log(c)^2 + 2*(n*log(c) - n)*log(x) - 2*log(c) + 2)*d^(n - 1)*x^n/n

________________________________________________________________________________________

giac [A]  time = 0.35, size = 99, normalized size = 1.87 \[ \frac {d^{n} n x^{n} \log \relax (x)^{2}}{d} + \frac {\frac {1}{d}^{n} x^{n} {\left | d \right |}^{2 \, n} \log \relax (c)^{2}}{d n} + \frac {2 \, d^{n} x^{n} \log \relax (c) \log \relax (x)}{d} - \frac {2 \, d^{n} x^{n} \log \relax (x)}{d} - \frac {2 \, d^{n} x^{n} \log \relax (c)}{d n} + \frac {2 \, d^{n} x^{n}}{d n} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x)^(-1+n)*log(c*x^n)^2,x, algorithm="giac")

[Out]

d^n*n*x^n*log(x)^2/d + (1/d)^n*x^n*abs(d)^(2*n)*log(c)^2/(d*n) + 2*d^n*x^n*log(c)*log(x)/d - 2*d^n*x^n*log(x)/
d - 2*d^n*x^n*log(c)/(d*n) + 2*d^n*x^n/(d*n)

________________________________________________________________________________________

maple [C]  time = 0.18, size = 750, normalized size = 14.15 \[ \text {result too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*x)^(n-1)*ln(c*x^n)^2,x)

[Out]

1/n*x*exp(1/2*(n-1)*(-I*Pi*csgn(I*d)*csgn(I*x)*csgn(I*d*x)+I*Pi*csgn(I*d)*csgn(I*d*x)^2+I*Pi*csgn(I*x)*csgn(I*
d*x)^2-I*Pi*csgn(I*d*x)^3+2*ln(d)+2*ln(x)))*ln(x^n)^2+(-I*Pi*csgn(I*c)*csgn(I*x^n)*csgn(I*c*x^n)+I*Pi*csgn(I*c
)*csgn(I*c*x^n)^2+I*Pi*csgn(I*x^n)*csgn(I*c*x^n)^2-I*Pi*csgn(I*c*x^n)^3+2*ln(c)-2)/n*x*exp(1/2*(n-1)*(-I*Pi*cs
gn(I*d)*csgn(I*x)*csgn(I*d*x)+I*Pi*csgn(I*d)*csgn(I*d*x)^2+I*Pi*csgn(I*x)*csgn(I*d*x)^2-I*Pi*csgn(I*d*x)^3+2*l
n(d)+2*ln(x)))*ln(x^n)+1/4*(-Pi^2*csgn(I*c)^2*csgn(I*x^n)^2*csgn(I*c*x^n)^2+2*Pi^2*csgn(I*c)^2*csgn(I*x^n)*csg
n(I*c*x^n)^3-Pi^2*csgn(I*c)^2*csgn(I*c*x^n)^4+2*Pi^2*csgn(I*c)*csgn(I*x^n)^2*csgn(I*c*x^n)^3-4*Pi^2*csgn(I*c)*
csgn(I*x^n)*csgn(I*c*x^n)^4+2*Pi^2*csgn(I*c)*csgn(I*c*x^n)^5-Pi^2*csgn(I*x^n)^2*csgn(I*c*x^n)^4+2*Pi^2*csgn(I*
x^n)*csgn(I*c*x^n)^5-Pi^2*csgn(I*c*x^n)^6-4*I*Pi*csgn(I*c)*csgn(I*x^n)*csgn(I*c*x^n)*ln(c)+4*I*Pi*csgn(I*c)*cs
gn(I*c*x^n)^2*ln(c)+4*I*Pi*csgn(I*x^n)*csgn(I*c*x^n)^2*ln(c)-4*I*Pi*csgn(I*c*x^n)^3*ln(c)+4*I*Pi*csgn(I*c)*csg
n(I*x^n)*csgn(I*c*x^n)-4*I*Pi*csgn(I*c)*csgn(I*c*x^n)^2-4*I*Pi*csgn(I*x^n)*csgn(I*c*x^n)^2+4*I*Pi*csgn(I*c*x^n
)^3+4*ln(c)^2-8*ln(c)+8)/n*x*exp(1/2*(n-1)*(-I*Pi*csgn(I*d)*csgn(I*x)*csgn(I*d*x)+I*Pi*csgn(I*d)*csgn(I*d*x)^2
+I*Pi*csgn(I*x)*csgn(I*d*x)^2-I*Pi*csgn(I*d*x)^3+2*ln(d)+2*ln(x)))

________________________________________________________________________________________

maxima [A]  time = 0.74, size = 53, normalized size = 1.00 \[ -\frac {2 \, d^{n - 1} x^{n} \log \left (c x^{n}\right )}{n} + \frac {2 \, d^{n - 1} x^{n}}{n} + \frac {\left (d x\right )^{n} \log \left (c x^{n}\right )^{2}}{d n} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x)^(-1+n)*log(c*x^n)^2,x, algorithm="maxima")

[Out]

-2*d^(n - 1)*x^n*log(c*x^n)/n + 2*d^(n - 1)*x^n/n + (d*x)^n*log(c*x^n)^2/(d*n)

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.02 \[ \int {\ln \left (c\,x^n\right )}^2\,{\left (d\,x\right )}^{n-1} \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(log(c*x^n)^2*(d*x)^(n - 1),x)

[Out]

int(log(c*x^n)^2*(d*x)^(n - 1), x)

________________________________________________________________________________________

sympy [A]  time = 43.86, size = 163, normalized size = 3.08 \[ \begin {cases} \tilde {\infty } x \log {\relax (c )}^{2} & \text {for}\: d = 0 \wedge n = 0 \\\frac {\log {\relax (c )}^{2} \log {\relax (x )}}{d} & \text {for}\: n = 0 \\0^{n - 1} \left (n^{2} x \log {\relax (x )}^{2} - 2 n^{2} x \log {\relax (x )} + 2 n^{2} x + 2 n x \log {\relax (c )} \log {\relax (x )} - 2 n x \log {\relax (c )} + x \log {\relax (c )}^{2}\right ) & \text {for}\: d = 0 \\\frac {d^{n} n x^{n} \log {\relax (x )}^{2}}{d} + \frac {2 d^{n} x^{n} \log {\relax (c )} \log {\relax (x )}}{d} - \frac {2 d^{n} x^{n} \log {\relax (x )}}{d} + \frac {d^{n} x^{n} \log {\relax (c )}^{2}}{d n} - \frac {2 d^{n} x^{n} \log {\relax (c )}}{d n} + \frac {2 d^{n} x^{n}}{d n} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x)**(-1+n)*ln(c*x**n)**2,x)

[Out]

Piecewise((zoo*x*log(c)**2, Eq(d, 0) & Eq(n, 0)), (log(c)**2*log(x)/d, Eq(n, 0)), (0**(n - 1)*(n**2*x*log(x)**
2 - 2*n**2*x*log(x) + 2*n**2*x + 2*n*x*log(c)*log(x) - 2*n*x*log(c) + x*log(c)**2), Eq(d, 0)), (d**n*n*x**n*lo
g(x)**2/d + 2*d**n*x**n*log(c)*log(x)/d - 2*d**n*x**n*log(x)/d + d**n*x**n*log(c)**2/(d*n) - 2*d**n*x**n*log(c
)/(d*n) + 2*d**n*x**n/(d*n), True))

________________________________________________________________________________________